﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter11.Code03.Code01
{
    public class ConvClass2
    {
        public double Val;

        //显式转换
        public static explicit operator ConvClass1(ConvClass2 cc2)
        {
            ConvClass1 returnVal = new ConvClass1();
            checked
            {
                returnVal.Val = (int)cc2.Val;
            }
            return returnVal;
        }
    }
}
